import { defineConfig } from 'vite'
import path from "path";

// https://vitejs.dev/config/
export default defineConfig({
  // 1. 提取公共依赖（node_modules）
  build: {
    rollupOptions: {
      output: {
        manualChunks: {
          vendor: ['node_modules'], // 提取第三方依赖
        },
      },
    },
  },
  // 2. 样式优化
  css: {
  },
  plugins: [],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src'),
      '@components': path.resolve(__dirname, 'src/components'),
      '@assets': path.resolve(__dirname, 'assets'),
      '@store': path.resolve(__dirname, 'store'),
      '@styles': path.resolve(__dirname, 'styles'),
    },
  },
})